CPU 686
BITS 32

%define DATA_REG 0x60
%define EOI 0x20
%define PIC1_CMD 0x20

global _kbd_isr
global _scancode

;extern _keys_queue
;extern _queuePut

;global _kika

section .data

_scancode dd 0
;_kika dd 0

section .text

_kbd_isr:
	push eax
	
	xor eax, eax
	in al, DATA_REG
	mov dword[_scancode], eax
	
	;push eax
	;push _keys_queue
	;call _queuePut
	;add esp, 8
	
	;cmp eax, 0
	;je fim
	
	;mov dword[_kika], 1
fim:
	mov al, EOI
	out PIC1_CMD, al

	pop eax
	iretd
END
